import fetch from "@/utils/fetch";

// 说明：抄表审核分页查询(条件搜索)
// 接口：api/cb/flManualReading/search2/{page}/{size}
// 请求类型：post
export function searchFlManualReading(page, size, obj) {
    return fetch({
        url: "api/cb/flManualReading/search2/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// 说明：获取单个手工抄表
// 接口：api/cb/flManualReading/{id}
// 请求类型：get
export function findImgById(id) {
    return fetch({
        url: "api/cb/flManualReading/findImgById/" + id,
        method: "get",
    });
}

// 导出Xlsx
export function exprotXls(ids, obj) {
    return fetch({
        url: "api/cb/flManualReading/exprotXlsSh/" + ids,
        responseType: "blob",
        method: "post",
        data: obj,
    });
}

// 导入Xlsx
export function importXls(obj) {
    return fetch({
        url: "api/cb/flManualReading/importXls",
        method: "post",
        data: obj,
    });
}
// 下载模板
export function downTem() {
    return fetch({
        url: "api/cb/flManualReading/exprotExcelModelForPenman",
        responseType: "blob",
        // responseType: 'arraybuffer',
        method: "get",
    });
}

export function updateAllTrue(obj) {
    return fetch({
        url: "api/cb/flManualReading/updateAllTrue",
        method: "put",
        data: obj,
    });
}

export function updateTrue(obj) {
    return fetch({
        url: "api/cb/flManualReading/updateTrue",
        method: "put",
        data: obj,
    });
}

export function updateAllFalse(obj) {
    return fetch({
        url: "api/cb/flManualReading/updateAllFalse",
        // responseType: 'arraybuffer',
        method: "put",
        data: obj,
    });
}

// POST /flWaterMeterInfo/sendToBusiness
// 立即推送读数到营收
// 请求类型：get
export function sendToBusiness() {
    return fetch({
        url: "api/cb/flWaterMeterInfo/sendToBusiness",
        method: "post",
    });
}
// 勾选推送 POST /flWaterMeterInfo/sendToBusiness
export function sendFun(ids) {
    return fetch({
        url: `api/business/flReadBusinessMiddle/batchPushData`,
        method: "post",

        data: { ids },
    });
}

// 勾选 批量结束 /flManualReading/updateAllEnd
export function stopWater(ids) {
    return fetch({
        url: `api/cb/flManualReading/updateAllEnd`,
        method: "put",
        data: ids,
    });
}

//  /flReadBusinessMiddle/nbMeterReadingPush
// 全部推送
// 请求类型：get
export function pushAll() {
    return fetch({
        url: "api/business/flReadBusinessMiddle/nbMeterReadingPush",
        method: "get"
    });
}